Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processor] Save the merged report and infer labels from browser_channel #529

Merged
merged 2 commits into from
Sep 14, 2018

Conversation

Hexcles
Copy link
Member

@Hexcles Hexcles commented Sep 10, 2018

This change makes the results processor to save the merged report
instead of just the last chunk of the report if the original report is
chunked when uploaded.

Besides, it also sets the channel label (stable/experimental) based on a
new property in the report, run_info.browser_channel, introduced in
web-platform-tests/wpt#12679 .

Review

The integration, including the modified upload process for full raw reports, is tested by deploying to staging.wpt.fyi. The heuristics for adding labels are tested in unit tests.

@Hexcles Hexcles requested a review from foolip September 10, 2018 22:10
@@ -168,11 +168,19 @@ def task_handler():
# to tell TaskQueue to drop the task.
return ('', HTTPStatus.NO_CONTENT)

resp = "{} results loaded from {}\n".format(len(report.results), gcs_path)
resp = "{} results loaded from {}\n".format(
len(report.results), str(gcs_paths))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other reviewers, what changed here is str(gcs_paths).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, gcs_path is the last item in gcs_paths, the iteration variable, and it wasn't intended to be used outside of the loop.

def serialize_gzip(self, filepath):
"""Serializes and gzips the in-memory report to a file.

finalize() should be called first.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens otherwise? Can anything be asserted to make sure it has been called?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, on a second thought, there's no need to call finalize here, as this method only serializes the report itself, not the metadata or summary. Let me remove this line.

labels.add('stable')
# Extract browser_channel into a label; default to "stable".
if report.run_info.get('browser_channel') in {'nightly', 'dev'}:
labels.add('experimental')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you split out this change? Letting the experimental label be implied seems risky if we're going to let it mean "dev with extra features enabled".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me split it into a separate commit, but still in this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I guess you usually merge for PRs where you've made the history nice?

WDYT about "Letting the experimental label be implied seems risky"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, there is another issue here, meaning that in https://staging.wpt.fyi/test-runs?label=taskcluster two of the runs for 9614def are identified as stable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh those are beta results. Let me add the "beta" label here.

Copy link
Member Author

@Hexcles Hexcles Sep 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@foolip I just updated the second commit in this PR to add the "beta" label.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Is there an issue for adding beta icons as well?

This change makes the results processor to save the merged report
instead of just the last chunk of the report if the original report is
chunked when uploaded.
@Hexcles
Copy link
Member Author

Hexcles commented Sep 11, 2018

@foolip PTAL again.

@Hexcles Hexcles changed the title [processor] Save the merged report [processor] Save the merged report and infer labels from browser_channel Sep 11, 2018
@wpt-pr-bot
Copy link

Staging instance deployed by Travis CI!
Running at https://save-merged-report-dot-processor-dot-wptdashboard-staging.appspot.com

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't block on me if other reviewers are happy.

labels.add('stable')
# Extract browser_channel into a label; default to "stable".
if report.run_info.get('browser_channel') in {'nightly', 'dev'}:
labels.add('experimental')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I guess you usually merge for PRs where you've made the history nice?

WDYT about "Letting the experimental label be implied seems risky"?

@Hexcles
Copy link
Member Author

Hexcles commented Sep 12, 2018

@foolip ah you're actually the only reviewer for this PR :) I sent the Go part to Luke (#536 ).

Regarding the risks of inferring labels, I think it's pretty low: we only infer it when the uploader doesn't set stable or experimental, and when browser_channel is present in the report. And browser_channel is pretty reliable.

When the uploader does not provide a channel label, the processor will
now set it based on a new property in the report,
`run_info.browser_channel`, introduced in
web-platform-tests/wpt#12679 .

A new channel label, "beta", is also introduced in this commit, since we
now have beta browsers running on Taskcluster daily.
Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, inferring label isn't the main mechanism by which it happens, that's fine then.

@Hexcles Hexcles merged commit 45c4c5c into master Sep 14, 2018
@Hexcles Hexcles deleted the save-merged-report branch September 14, 2018 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants